e28490bc0ac93c7e6cbdf0e27fe09c3776e93193
[git-annex.git] /
1 [[!comment format=mdwn
2  username="lykos@d125a37d89b1cfac20829f12911656c40cb70018"
3  nickname="lykos"
4  avatar="http://cdn.libravatar.org/avatar/085df7b04d3408ba23c19f9c49be9ea2"
5  subject="comment 2"
6  date="2020-03-26T20:36:28Z"
7  content="""
8 When testing a new version of git-annex-remote-googledrive, I often use a wrapper script like this:
9
10 ```
11 # .zshrc.local
12
13 f_git_annex () {
14         log_file=$(mktemp \"$(git rev-parse --git-dir 2>/dev/null)/annex/debug.XXX.log\" 2>/dev/null)
15         if [ $? -ne 0 ]; then
16                 echo \"Error creating log file. Proceeding without logging.\"
17                 git annex $@
18                 return $?
19         fi
20
21         git annex $@ --debug 2> $log_file
22         if [ $? -ne 0 ]; then
23                 echo \"Errors occurred. Debug log in $log_file\"
24                 return $?
25         else
26                 rm $log_file
27         fi
28       }
29 alias ga='f_git_annex'
30 ```
31 It's good enough for me in those cases. Changing the first line of the function to something like this
32 ```
33 log_file=$(umask 077; mktemp /tmp/annex.debug.XXX.log\" 2>/dev/null)
34 ```
35 would help against accumulating logs.
36 """]]